package com.ruijixiang.leetcode.everyday.leetcode2024.leetcode202408;

public class leetcode20240829 {
    public boolean satisfiesConditions(int[][] grid){
        for(int i=0;i<grid.length;i++){
            for(int j=0;j<grid[0].length;j++){
                if(j>0 && grid[i][j]==grid[i][j-1] || i>0 && grid[i][j]!=grid[i-1][j]) return false;
            }
        }
        return true;
    }
}
